Skip to content

Conversation

@VisLab
Copy link
Member

@VisLab VisLab commented Feb 9, 2025

@rwblair In looking at hed.js it looks as though the hedSchemas object is being reloaded for every file being validated. Since the HED schema version specification is the same for an entire BIDS dataset, it need only be loaded once.

@happy5214 (FYI)

@VisLab
Copy link
Member Author

VisLab commented Feb 9, 2025

@effigies @rwblair: The reason that this is failing seems to be that the global variable hedSchemas is not being reset after each complete BIDS dataset. There are two ways to fix this:

  1. Reset hedSchemas after each dataset (I don't know where this would be done in the BIDS.)
  2. Alternatively, we could introduce a second global variable that is the current version and check that the new HED version is the same as the one in the global variables and skip the complete rebuilding of the schema after each file is read.

What do you advise?

@effigies
Copy link
Contributor

effigies commented Feb 9, 2025

I think the better solution is probably to add some kind of HED validation object (maybe just hedSchemas?) to the dataset context, rather than keeping it as a global variable.

@effigies
Copy link
Contributor

effigies commented Feb 9, 2025

@VisLab I pushed a quick patch. I don't know if it's optimal, but it seems to work, with local tests.

@VisLab
Copy link
Member Author

VisLab commented Feb 9, 2025

I was uncomfortable with the global variable approach. This is much better. Thanks!

@effigies effigies merged commit 55a00e3 into bids-standard:main Feb 9, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants